/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.xtd.facade.inventory;

import com.xtd.facade.AbstractFacade;
import com.xtd.model.inventory.InventoryRecord;
import javax.ejb.Stateless;

/**
 *
 * @author Lu Yuanbin
 */
@Stateless
public class InventoryRecordFacade extends AbstractFacade<InventoryRecord> {
 

    public InventoryRecordFacade() {
        super(InventoryRecord.class);
    }

    public void confirmCommodityStock(InventoryRecord inventoryRecord) {
        if(inventoryRecord.getId() == null) {
            create(inventoryRecord);
        } else {
            edit(inventoryRecord);
        }
        getEntityManager().merge(inventoryRecord.getOrderCommodity());
    }
}
